define(['app'],function(app){return {module: function($scope, $http, eventBusService, httpService, params, configService) {
        $scope.form = {};
        $scope.menu_name = "学生管理";


        //性别
        httpService.post(app.urls.dictionary_selectOne, {fk_rule:'SJAAAAA29'}, function(data) {
            if("0000" === data.code) {
                $scope.sexList = data.data;
            } else {
                eventBusService.publish("modal.alert", {"content": data.msg});
            }
        });


        $scope.save = function() {
            if (!$scope.formCheck()){
                return;
            }
            $scope.form.id = $scope.form.fk_user;
            $scope.form.yhm = $scope.form.fk_user;
            var year = (new Date()).getFullYear();
            $scope.form.year = year
            httpService.post(app.urls.newStudent_insert, $scope.form,function(data){
                if("0000" === data.code){
                    eventBusService.publish("modal.alert", {"content": "添加成功"});
                    eventBusService.publish("content.page.reload", null);
                    eventBusService.publish("modal.page.close",{});
                }else{
                    alert(data.msg);
                }
            });
        }

}}});
